<ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
	    xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
	    template="template.xhtml">
	<ui:define name="title">Add Show</ui:define>
	<ui:define name="content">
		<h:form>
			<fieldset id="addShowPanel">
      			<h:panelGrid columns="4">
					<h:outputLabel value="Search for:" for="name" />
					<h:inputText id="name" value="#{addShowBean.name}" style="width: 200px;" />
                    <h:commandButton value="Search" action="#{addShowBean.search}" />
                    <h:commandLink value="Cancel" action="listShows.xhtml" immediate="true" />
      			</h:panelGrid>
      			<br />
      			<h:panelGrid columns="2" rendered="#{not empty addShowBean.shows}">
	                <h:selectOneListbox value="#{addShowBean.selectedShowId}" style="width: 350px; height: 200px">
	                    <f:selectItems value="#{addShowBean.shows}" var="show" itemValue="#{show.id}" itemLabel="#{show.name}" />
	                </h:selectOneListbox>
	                <h:commandButton value="Add" action="#{addShowBean.add}" />
                </h:panelGrid>
			</fieldset>
		</h:form>
	</ui:define>
</ui:composition>
